package com.itheima.mapper;

import com.itheima.pojo.OrderSetting;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface OrderSettingDao {

    @Select("select * from t_ordersetting WHERE orderDate BETWEEN #{startDate} and #{endDate}")
    List<OrderSetting> getMatchCountByDate(@Param("startDate") String startDate, @Param("endDate") String endDate);


    int add(@Param("orderSettings") List<OrderSetting> orderSettings);

    @Delete("delete from t_ordersetting where orderDate BETWEEN #{startDate} and #{endDate}")
    int deleteByMatchDate(@Param("startDate") String startDate, @Param("endDate") String endDate);

    int update(@Param("orderSettings") List<OrderSetting> orderSettings);

    @Select("select * from t_ordersetting where orderDate = #{orderDate}")
    OrderSetting getByDate(String orderDate);

    @Update("update t_ordersetting set number = #{number} where orderDate = #{orderDate}")
    int updateByDate(OrderSetting orderSetting);


    List<OrderSetting> getOrderSettingByMonth(@Param("year") String year, @Param("month")String month);
}
